package com.ww.yaodao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ww.yaodao.mapper.CustomPayInfoMapper;
import com.ww.yaodao.model.bo.CustomPayInfoDO;
import com.ww.yaodao.model.vo.custom.CustomRespVO;
import com.ww.yaodao.service.CustomPayInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomPayInfoServiceImpl implements CustomPayInfoService {
    @Autowired
    private CustomPayInfoMapper customPayInfoMapper;
    @Override
    public List<CustomPayInfoDO> infolist(String orderNum) {
        LambdaQueryWrapper<CustomPayInfoDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(CustomPayInfoDO::getOrderNumber,orderNum);
        List<CustomPayInfoDO> customPayInfos = customPayInfoMapper.selectList(wrapper);
        return customPayInfos;
    }

    @Override
    public CustomRespVO getAllCustom() {
        List<CustomPayInfoDO> customPayInfoDOS = customPayInfoMapper.selectList(null);
        CustomRespVO build = CustomRespVO.builder().list(customPayInfoDOS).build();
        return build;
    }
}
